<!-- 回复评论  集合 -->
	
	<!--  全局允许提交回复 -->
<!--	<#if returnValue['allowReply'] == true>-->
	<div class="commentReply-formModule">
		<div class="addReply-wrap">
			<form th:id="${replyId}+'_addReplyCommentForm'" th:action="@{'/user/control/comment/addReply'}" method="post">
				
				<!-- 提交后跳转参数  参数必须经过encodeBase64URL编码后才能提交 不填写时默认跳转回当前页 -->
				<input type="hidden" id="jumpUrl" name="jumpUrl" value="">
				<textarea class="reply-textarea" onfocus="" th:id="${replyId}+'_replyCommentContent'" name="content" placeholder="写下您的回复"></textarea>
				
				<span th:id="${replyId}+'_content_error'" class="error" ></span>
				<span th:id="${error}+'_reply_error'" class="error"></span>
				<div class="form-action">
					<!-- 获取评论Id -->
					<input type="hidden" th:id="${replyId}+'_commentId'" name="commentId" th:value="${replyId}">
					
					<div class="replySubmit">
						<span class="submitButton-box" >
							<button th:id="${replyId}+'_submitForm'" type="button" class="submitButton" th:onClick="javascript:ajax_reply_sureSubmit('[[${replyId}]]')">提交</button>
						</span>
						<!-- 调用方法在topicRelated_comment_page页 -->
						<span class="cancelButton-box" >
							<button type="button" class="cancelButton" th:onClick="javascript:cancelReply('[[${replyId}]]')">取消</button>
						</span>
					</div>
				</div>	
				
				
				
				<script language="javascript" type="text/javascript" th:inline="javascript">

					//表单Form方式提交
					function reply_sureSubmit(obj){
						obj.submit();
					} 
					//Ajax方式提交
					function ajax_reply_sureSubmit(identificationNumber){
						//按钮设置 disabled="disabled"
						document.getElementById(identificationNumber+"_submitForm").disabled=true;

							var parameter = "";
							//评论Id
							parameter += "commentId="+document.getElementById(identificationNumber+"_commentId").value;
							
							//获取内容
							var content = document.getElementById(identificationNumber+"_replyCommentContent").value;
							parameter += "&content="+encodeURIComponent(content);
						
						   	//删除第一个&号,防止因为多了&号而出现警告: Parameters: Invalid chunk ignored.信息
							if(parameter.indexOf("&") == 0){
								parameter = parameter.substring(1,parameter.length);
							}
						   	post_request(function(value){
								var data = JSON.parse(value);
						
								for(var returnValue in data){
									
									if(returnValue == "success"){
					        			if(data[returnValue] == "true"){
					        				//需引入layer
					        				layer.msg('提交成功,3秒后自动刷新本页', 
												{
												  time: 3000 //3秒关闭（如果不配置，默认是3秒）
												},function(){//关闭后的操作
													//刷新页面
					        						document.location.reload();
												}
											);
					        			}
					        		}else if(returnValue == "error"){
					        			
					        			var error = data[returnValue];
					        			for(var key in error){
					        				var error_html = document.getElementById(identificationNumber+"_"+key+"_error");
	
					        				if(error_html != null){
					        					error_html.innerHTML = error[key];
					        				}
					        				
					        			}
					        			//按钮设置 disabled="disabled"
										document.getElementById(identificationNumber+"_submitForm").disabled=false;
					        		}
					        	}
							},
								[[@{'user/control/comment/addReply?'}]] +parameter, true);
							//按钮设置 disabled="disabled"
							document.getElementById(identificationNumber+"_submitForm").disabled=false;
					} 
				</script>
			</form>
		</div>
	</div>
<!--		<div class="commentReply-disableFormModule">-->
<!--			<div class="disableForm-wrap">-->
<!--				<div class="respond">-->
<!--					<p>不允许回复评论</p>-->
<!--				</div>-->
<!--			</div>-->
<!--		</div>-->
